<?php
		$finalstatusByDecision='pass';		
		
		if(!isset($_POST['LoanAmount']) || empty($_POST['LoanAmount'])){
			$loanamount = NULL;}
		else{
			$loanamount = $_POST['LoanAmount'];}
			
		if(!isset($_POST['due_month']) || empty($_POST['due_month'])){
			$term = NULL;}
		else{
			$term = $_POST['due_month'];}
			
		if(!isset($_POST['browser']) || empty($_POST['browser'])){
			$mc_browser =  NULL;}
		else{
			$mc_browser = $_POST['browser'];
		}
		
		if(!isset($_POST['ipaddress']) || empty($_POST['ipaddress'])){
			$mc_ipaddress = NULL;}//ipaddress
		else{
			$mc_ipaddress = $_POST['ipaddress'];}//ipaddress

		if(!isset($_POST['Title2']) || empty($_POST['Title2'])){
			$title = NULL;}
		else{
			$title = $_POST['Title2'];}			
			
		if(!isset($_POST['FirstName1']) || empty($_POST['FirstName1'])){
			$firstname = NULL;}
		else{
			$firstname = $_POST['FirstName1'];}
			
		if(!isset($_POST['MiddleName1']) || empty($_POST['MiddleName1'])){
			$middlename = NULL;}
		else  {
			$middlename = $_POST['MiddleName1'];}
			
		if(!isset($_POST['Surname1']) || empty($_POST['Surname1'])){
			$surname = NULL;}
		else{
			$surname = $_POST['Surname1'];}
			
		if(!isset($_POST['Residency2']) || empty($_POST['Residency2'])){
			$citizenship = NULL;}
		else{
			$citizenship = $_POST['Residency2'];}
			
		if(!isset($_POST['DateOfBirth1']) || empty($_POST['DateOfBirth1'])){
			$dateofbirth = NULL;}
		else{
			$dateofbirth = $_POST['DateOfBirth1'];}
			
		if(!isset($_POST['ResidentialAddress2']) || empty($_POST['ResidentialAddress2'])){
			$residentialaddress = NULL;}
		else{
			$residentialaddress = $_POST['ResidentialAddress2'];}
		
		if(!isset($_POST['ResidentialStatus1']) || empty($_POST['ResidentialStatus1'])){
			$residentialstatus = NULL;}
		else{
			$residentialstatus = $_POST['ResidentialStatus1'];}								
			
		if(!isset($_POST['Number1']) || empty($_POST['Number1'])){
			$streetnumber = NULL;}
		else{
			$streetnumber = $_POST['Number1'];}
			
		if(!isset($_POST['Street1']) || empty($_POST['Street1'])){
			$street = NULL;}
		else{
			$street = $_POST['Street1'];}
			
		if(!isset($_POST['StreetType1']) || empty($_POST['StreetType1'])){
			$streettype = NULL;}
		else{
			$streettype = $_POST['StreetType1'];}
			
		if(!isset($_POST['Suburb1']) || empty($_POST['Suburb1'])){
			$suburb = NULL;}
		else{
			$suburb = $_POST['Suburb1'];}
			
		if(!isset($_POST['State1']) || empty($_POST['State1'])){
			$state = NULL;}
		else{
			$state = $_POST['State1'];}
			
		if(!isset($_POST['Postcode1']) || empty($_POST['Postcode1'])){
			$postcode = NULL;}
		else{
			$postcode = $_POST['Postcode1'];}
		
		if(!isset($_POST['LengthOfResidenceYear1']) || empty($_POST['LengthOfResidenceYear1'])){
			$residenceperiod = NULL;}
		else{
			$residenceperiod = $_POST['LengthOfResidenceYear1'];}				
		
		if(!isset($_POST['Mobile1']) || empty($_POST['Mobile1'])){
			$mobile = NULL;}
		else{
			$mobile = $_POST['Mobile1'];}
			
		if(!isset($_POST['Phone1']) || empty($_POST['Phone1'])){
			$phone = NULL;}
		else{
			$phone = $_POST['Phone1'];}
			
		if(!isset($_POST['EMailAddress1']) || empty($_POST['EMailAddress1'])){
			$emailaddress = NULL;}
		else{
			$emailaddress = $_POST['EMailAddress1'];}
			
		if(!isset($_POST['PurposeOfLoan2']) || empty($_POST['PurposeOfLoan2'])){
			$purposeofloan = NULL;}
		else{
			$purposeofloan = $_POST['PurposeOfLoan2'];}
			
		if(!isset($_POST['NumberofDependant1']) || empty($_POST['NumberofDependant1'])){
			$numberofdependant = NULL;}
		else{
			$numberofdependant = $_POST['NumberofDependant1'];}			
			
		if(!isset($_POST['TypeOfEmployment2']) || empty($_POST['TypeOfEmployment2'])){
			$typeofemployment = NULL;}
		else{
			$typeofemployment = $_POST['TypeOfEmployment2'];}
			
		if(!isset($_POST['TitleInOccupation1']) || empty($_POST['TitleInOccupation1'])){
			$titleinoccupation = NULL;}
		else{
			$titleinoccupation = $_POST['TitleInOccupation1'];}
			
		if(!isset($_POST['BusinessName1']) || empty($_POST['BusinessName1'])){
			$businessname = NULL;}
		else{
			$businessname = $_POST['BusinessName1'];}
			
		if(!isset($_POST['WorkPhone1']) || empty($_POST['WorkPhone1'])){
			$workphone = NULL;}
		else{
			$workphone = $_POST['WorkPhone1'];}
		
		if(!isset($_POST['Liabilities']['LoanRepayment']['payment']) || empty($_POST['Liabilities']['LoanRepayment']['payment'])){
			$liabilitiesloanrepaymentpayment = NULL;}
		else{
			$liabilitiesloanrepaymentpayment = $_POST['Liabilities']['LoanRepayment']['payment'];}
			
		if(!isset($_POST['Liabilities']['CreditCard']['payment']) || empty($_POST['Liabilities']['CreditCard']['payment'])){
			$liabilitiescreditcardpayment = NULL;}
		else{
			$liabilitiescreditcardpayment = $_POST['Liabilities']['CreditCard']['payment'];}
			
		if(!isset($_POST['Liabilities']['BoardingRentingFee']['payment']) || empty($_POST['Liabilities']['BoardingRentingFee']['payment'])){
			$liabilitiesboardingrentingfeepayment = NULL;}
		else{
			$liabilitiesboardingrentingfeepayment = $_POST['Liabilities']['BoardingRentingFee']['payment'];}	
			
		if(!isset($_POST['Liabilities']['LivingExpenses']['payment']) || empty($_POST['Liabilities']['LivingExpenses']['payment'])){
			$liabilitieslivingexpensespayment = NULL;}
		else{
			$liabilitieslivingexpensespayment = $_POST['Liabilities']['LivingExpenses']['payment'];}
			
		if(!isset($_POST['LoanRepaymentPeriod']) || empty($_POST['LoanRepaymentPeriod'])){
			$loanrepaymentperiod = NULL;}
		else{
			$loanrepaymentperiod = $_POST['LoanRepaymentPeriod'];}					
			
		if(!isset($_POST['CreditCardPaymentPeriod']) || empty($_POST['CreditCardPaymentPeriod'])){
			$creditcardpaymentperiod = NULL;}
		else{
			$creditcardpaymentperiod = $_POST['CreditCardPaymentPeriod'];}					
			
		if(!isset($_POST['BoardingRentingPeriod']) || empty($_POST['BoardingRentingPeriod'])){
			$boardingrentingperiod = NULL;}
		else{
			$boardingrentingperiod = $_POST['BoardingRentingPeriod'];}					
			
		if(!isset($_POST['LivingExpensesPeriod']) || empty($_POST['LivingExpensesPeriod'])){
			$livingexpensesperiod = NULL;}
		else{
			$livingexpensesperiod = $_POST['LivingExpensesPeriod'];}
			
		if(!isset($_POST['Hardship1']) || empty($_POST['Hardship1'])){
			$hardship = NULL;}
		else{
			$hardship = $_POST['Hardship1'];}
			
		if(!isset($_POST['Gambling1']) || empty($_POST['Gambling1'])){
			$Gambling = NULL;}
		else{
			$Gambling = $_POST['Gambling1'];}
		if(!isset($_POST['CreditHistory2']) || empty($_POST['CreditHistory2'])){
			$credithistory = NULL;}
		else{
			$credithistory = $_POST['CreditHistory2'];}
			
		if(!isset($_POST['totalOutstanding2']) || empty($_POST['totalOutstanding2'])){
			$totaloutstanding = NULL;}
		else{
			$totaloutstanding = $_POST['totalOutstanding2'];}
			
		if(!isset($_POST['DateOfDischarge1']) || empty($_POST['DateOfDischarge1'])){
			$dateofdischarge = NULL;}
		else{
			$dateofdischarge = $_POST['DateOfDischarge1'];}
			
		if(!isset($_POST['DefaultAfterDischarge1']) || empty($_POST['DefaultAfterDischarge1'])){
			$defaultafterdischarge = NULL;}
		else{
			$defaultafterdischarge = $_POST['DefaultAfterDischarge1'];}
			
		if(!isset($_POST['WhyChooseMF']) || empty($_POST['WhyChooseMF'])){
			$whychoosemf = NULL;}
		else{
			$whychoosemf = $_POST['WhyChooseMF'];}
			
		if(!isset($_POST['ExistingClient']) || empty($_POST['ExistingClient'])){
			$existingclient = NULL;}
		else{
			$existingclient = $_POST['ExistingClient'];	}
			
		if(!isset($_POST['AgreePrivacyCredit']) || empty($_POST['AgreePrivacyCredit'])) {
			$mc_agreement = NULL; //AgreePrivacyCredit
		} 
		else{
         	$mc_agreement = $_POST['AgreePrivacyCredit']; //AgreePrivacyCredit
		}	
		
		if(!isset($_POST['OtherPurpose']) || empty($_POST['OtherPurpose'])){
			$mc_OtherPurpose = NULL;}  //OtherPurpose
		else{
			$mc_OtherPurpose = $_POST['OtherPurpose'];}	
			
		/*
				
			
		if(!isset($_POST['IncomeAfterTax1']) || empty($_POST['IncomeAfterTax1'])){
			$incomeaftertax = NULL;}
		else{
			$incomeaftertax = $_POST['IncomeAfterTax1'];}
			
		if(!isset($_POST['IncomeAfterTax1Period']) || empty($_POST['IncomeAfterTax1Period'])){
			$incomeaftertax1period = NULL;}
		else{
			$incomeaftertax1period = $_POST['IncomeAfterTax1Period'];}
			
		if(!isset($_POST['CentrelinkIncome1']) || empty($_POST['CentrelinkIncome1'])){
			$CentrelinkIncome1 = NULL;}
		else{
			$CentrelinkIncome1 = $_POST['CentrelinkIncome1'];}
			
		if(!isset($_POST['OtherIncomeSpecify1']) || empty($_POST['OtherIncomeSpecify1'])){
			$OtherIncomeSpecify1 = NULL;}
		else{
			$OtherIncomeSpecify1 = $_POST['OtherIncomeSpecify1'];}
			
		if(!isset($_POST['RentalIncome1']) || empty($_POST['RentalIncome1'])){
			$RentalIncome1 = NULL;}
		else{
			$RentalIncome1 = $_POST['RentalIncome1'];}
			
		if(!isset($_POST['OtherIncomePeriod1']) || empty($_POST['OtherIncomePeriod1'])){
			$OtherIncomePeriod1 = NULL;}
		else{
			$OtherIncomePeriod1 = $_POST['OtherIncomePeriod1'];}
															
		if(!isset($_POST['loanInLastTwoMonth']) || empty($_POST['loanInLastTwoMonth'])){
			$loaninlasttwomonth = NULL;}
		else{
			$loaninlasttwomonth = $_POST['loanInLastTwoMonth'];}
		 
        if(!isset($_POST['LengthOfResidenceYear1']) || empty($_POST['LengthOfResidenceYear1'])){
			$residencelength = NULL;}
		else{
			$residencelength = $_POST['LengthOfResidenceYear1'];}					
			
		if(!isset($_POST['loginpassword']) || empty($_POST['loginpassword'])){
                        $loginpassword = NULL;}
		else{
                        $loginpassword = $_POST['loginpassword'];}
		*/
		